{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请你输入一个数字60\n",
      "你的数字猜大了\n",
      "请你输入一个数字50\n",
      "你的数字猜大了\n",
      "请你输入一个数字40\n",
      "你的数字猜大了\n",
      "请你输入一个数字30\n",
      "你的数字猜小了\n",
      "请你输入一个数字35\n",
      "你太棒了，猜对了!\n",
      "35\n"
     ]
    }
   ],
   "source": [
    "import random\n",
    "hide_digit=random.randint(1,100)\n",
    "count=0\n",
    "while count<20:\n",
    "    shuru=input(\"请你输入一个数字\")\n",
    "    guess_digit=int(shuru)\n",
    "    if guess_digit==hide_digit:\n",
    "        print(\"你太棒了，猜对了!\")\n",
    "        print(hide_digit)\n",
    "    elif guess_digit<hide_digit:\n",
    "        print(\"你的数字猜小了\")\n",
    "    else:\n",
    "        print(\"你的数字猜大了\")\n",
    "    count+=1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
